/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Dao;

import java.util.List;
import model.Cdrlog;
import model.Reportegeneral;
import model.Reporterecargas;
import org.hibernate.Session;
import util.HibernateUtil;

/**
 *
 * @author Joel
 */
public class CdrDao {
    
    public Reportegeneral buscarporId(String id) {
        Session session = HibernateUtil.getSessionFactory().openSession();
        return (Reportegeneral) session.createQuery("from Reportegeneral where src="+id).uniqueResult();
    }
   
    public List<Cdrlog> llamadassalientes(String id)
    {
        Session session = HibernateUtil.getSessionFactory().openSession();
        return session.createQuery("from Cdrlog where src="+id).list();
    }
    public List<Cdrlog> llamadasentrantes(String id)
    {
        Session session = HibernateUtil.getSessionFactory().openSession();
        return session.createQuery("from Cdrlog where dst="+id).list();
    }
    
    public List<Reporterecargas> reporterecargas(String id)
    {
         Session session = HibernateUtil.getSessionFactory().openSession();
        return session.createQuery("from Reporterecargas where src="+id).list();
    }
    
}
